var app = getApp();

function request(url1, postData, doSuccess, doFail, doComplete) {
  wx.showNavigationBarLoading();
  wx.request({
    // url: 'http://localhost:8080/aip_wechat/' + url1,
     url: 'https://chendong00.top/aip_wechat/' + url1,
    data: postData,
    method: 'POST',
    header: {
      "Content-Type": "application/x-www-form-urlencoded;charset=utf-8"
    },
    success: function(res) {
      var timer = setTimeout(function() {
        wx.hideNavigationBarLoading();
      }, 500);
      if (typeof doSuccess == "function") {
        doSuccess(res);
      }
    },
    fail: function() {
      if (typeof doFail == "function") {
        doFail();
      }
    },
    complete: function() {
      if (typeof doComplete == "function") {
        doComplete();
      }
    }
  });
};
module.exports.request = request;